<template>
	<div class="member">
		<!-- tab切换栏 -->
		<tab :options="options" :type="form.type" @handleClick="handleClick"></tab>
		<!-- 会员列表页面 -->
		<div class="top" v-show="msgpush.topShow">
			<div class="socialTitle clearfix">
				<div class="titleName fl">
					<span>{{title}}</span>
					<span>（{{total}}个）</span>
				</div>
				<div class="export-btn fr" @click="exportData" v-if="form.type === '0' && btnAuthority.hygldcBtn">
					<img src="../../assets/img/export.png" alt>
					<span>导出</span>
				</div>
				<div class="export-btn fr" @click="exportData" v-if="form.type === '1' && btnAuthority.hmddcBtn">
					<img src="../../assets/img/export.png" alt>
					<span>导出</span>
				</div>
			</div>
			<el-form class="main" :inline="true" :model="form" label-width="80px" lass="demo-form-inline" ref="memberForm">
				<el-row>
					<el-col :span="9">
						<el-form-item label="会员名称" prop="nickname">
							<el-input v-model="form.nickname" placeholder="请输入会员名称" clearable></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="7" style="text-align: center;">
						<el-form-item label="居住地" prop="region">
							<city-Cascader :citys="form.citys" :level="level" @handleChange="handleCityChange" style="width: 190px;"></city-Cascader>
						</el-form-item>
					</el-col>
					<el-col :span="8" style="text-align: right;">
						<el-form-item label="学   历" prop="education">
							<el-select style="width: 190px;" v-model="form.education" placeholder="请选择" clearable>
								<el-option v-for="item in edulist" :key="item.value" :label="item.label" :value="item.value"></el-option>
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="9">
						<el-form-item label="年龄段">
							<el-input v-model="form.minage" placeholder="请选择" style="width:120px" clearable @change="handleChangeInput"></el-input>
							<span>~</span>
							<el-input v-model="form.maxage" placeholder="请选择" style="width:120px" clearable @change="handleChangeInput2"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="7" style="text-align: center;">
						<el-form-item label="性   别" prop="sex">
							<el-select style="width: 190px;" v-model="form.sex" placeholder="请选择" clearable>
								<el-option v-for="item in sex" :key="item.value" :label="item.label" :value="item.value"></el-option>
							</el-select>
						</el-form-item>
					</el-col>
					<el-col :span="8" style="text-align: right;">
						<el-form-item label="用户编号" prop="tdaccount">
							<el-input v-model="form.tdaccount" placeholder="请输入用户编号" clearable></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="9">
						<el-form-item label="实名用户" prop="username">
							<el-input v-model="form.username" placeholder="请输入实名用户" clearable></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="7" style="text-align: center;">
						<el-form-item label="证件号码" prop="cardnum">
							<el-input v-model="form.cardnum" placeholder="请输入证件号码" clearable></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="8" style="text-align: right;">
						<el-form-item label="求职状态" prop="jobstatus">
							<el-select style="width: 190px;" v-model="form.jobstatus" placeholder="请选择" clearable>
								<el-option v-for="item in jobstatuslist" :key="item.value" :label="item.label" :value="item.value"></el-option>
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :span="9">
						<el-form-item label="手机号码">
							<el-input v-model="form.telnum" placeholder="请输入手机号码" clearable></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="7" style="text-align: center;">
						<el-form-item prop="selectFunctions" label="职能">
							<el-cascader clearable ref="cascader" placeholder="选择职能" :options="functionOption" v-model="selectFunctions"
							 class="cascader-box" @change="functionChange" :props="functionProps" expand-trigger="hover" :show-all-levels="false">
								<i slot="suffix" class="el-input__icon el-icon-menu"></i>
							</el-cascader>
						</el-form-item>
					</el-col>
					<el-col :span="8" style="text-align: right;">
						<el-form-item>
							<!-- <el-button style="width: 120px;" @click="reset">重置</el-button> -->
							<el-button type="primary" style="width: 120px;" @click="query()">查询</el-button>
						</el-form-item>
					</el-col>
				</el-row>
			</el-form>
		</div>
		<!-- 黑名单页面-->
		<div class="table-box" v-loading="loading" v-show="msgpush.otherTables">
			<el-table class="memberList-table" :data="memberList" cell-class-name="member-cell" header-cell-class-name="member-header"
			 :header-cell-style="{ background: '#cae5fa',color: '#727272' }" border stripe style="width: 100%" size="small">
				<el-table-column prop="tdaccount" label="会员ID" align="center" width="95">
					<template slot-scope="scope">
						<span>{{scope.row.tdaccount}}</span>
					</template>
				</el-table-column>
				<el-table-column prop="nickname" label="会员名称" align="center">
					<template slot-scope="scope">
						<span @click="handleClickNickName(scope.row)" style="color: #6b97eb;cursor: pointer;">{{scope.row.nickname}}</span>
					</template>
				</el-table-column>
				<el-table-column prop=" realname" label="实名姓名" align="center">
					<template slot-scope="scope">
						<span>{{scope.row.realname !== undefined?scope.row.realname:'-'}}</span>
					</template>
				</el-table-column>
				<el-table-column prop="cardnum" label="证件号码" align="center" min-width="100">
					<template slot-scope="scope">
						<span>{{scope.row.cardnum !== undefined?scope.row.cardnum:'-'}}</span>
					</template>
				</el-table-column>
				<el-table-column label="性别" align="center" max-width="80">
					<template slot-scope="scope">
						<span v-if="scope.row.sex==='1'">男</span>
						<span v-else-if="scope.row.sex==='2'">女</span>
						<span v-else>未知</span>
					</template>
				</el-table-column>
				<el-table-column prop="birthdate" label="出生日期" align="center"></el-table-column>
				<el-table-column prop="region" label="居住地" align="center"></el-table-column>
				<el-table-column prop="telnum" label="手机号码" align="center"></el-table-column>
				<el-table-column label="学历" align="center">
					<template slot-scope="scope">
						<span>{{scope.row.education || "未填"}}</span>
					</template>
				</el-table-column>
				<el-table-column label="求职状态" align="center">
					<template slot-scope="scope">
						<span v-if="scope.row.status==='1'">正在找工作</span>
						<span v-else-if="scope.row.status==='2'">在职，正考虑换个新环境</span>
						<span v-else-if="scope.row.status==='3'">在职，暂无跳槽打算</span>
						<span v-else-if="scope.row.status==='4'">在职，有更好的机会也可以考虑</span>
						<span v-else-if="scope.row.status==='5'">我要招聘</span>
						<span v-else-if="scope.row.status==='6'">已入职试用</span>
					</template>
				</el-table-column>
				<el-table-column label="注册时间" width="118px" align="center">
					<template slot-scope="scope">
						<span>{{scope.row.registertime}}</span>
					</template>
				</el-table-column>
				<el-table-column label="操作" min-width="100px" align="center" v-if="form.type === '0' && (btnAuthority.hygltxBtn || btnAuthority.hygllhBtn || btnAuthority.hyglsbBtn)">
					<template slot-scope="scope">
						<div>
							<el-button @click="handleClickWarn(scope.row)" type="text" size="small" v-if="btnAuthority.hygltxBtn">提醒</el-button>
							<el-button @click="handleClickBlacklist(scope.row)" type="text" size="small" style="color: #ff4c2c" v-if="btnAuthority.hygllhBtn">拉黑</el-button>
							<el-button @click="handleClickReport1(scope.row)" type="text" size="small" v-if="btnAuthority.hyglsbBtn">上报</el-button>
						</div>
					</template>
				</el-table-column>
				<el-table-column label="操作" width="120px" align="center" v-if="form.type === '1' && (btnAuthority.hmdhyBtn|| btnAuthority.hmdsbBtn)">
					<template slot-scope="scope">
						<div>
							<el-button type="text" @click="handleClickRecover(scope.row)" size="small" v-if="btnAuthority.hmdhyBtn">还原</el-button>
							<el-button @click="handleClickReport2(scope.row)" type="text" size="small" v-if="btnAuthority.hmdsbBtn">上报</el-button>
						</div>
					</template>
				</el-table-column>
			</el-table>
		</div>
		<!-- 工资单页面 -->
		<div class="top" v-show="msgpush.payrollTables">
			<div class="socialTitle clearfix">
				<div class="titleName fl">
					<span>收入管理</span>
				</div>
				<div class="export-btn fr" @click="payrollImportMsg.showDialog=true">
					<span class="el-icon-bottom"> 导入</span>
				</div>
			</div>
			<comSearch :options="searchMsg" @search="search"></comSearch>
			<comTable :options="payrollTableData" @openPayrollDetail="openPayrollDetail" @opendisplay="opendisplay" @deletedTemplate="deletedTemplate">
			</comTable>
		</div>
		<!-- 消息推送页面 -->
		
		<comNavTabs :navList="navList" @switch="tabSwitch" v-show="msgpush.selfTables"></comNavTabs>
		
		<div class="pushmsg" v-show="msgpush.selfTables">
			
			<el-button type="success" @click="messendByapp" class="add-msg" v-show="navList.index==0">+新增消息推送</el-button>
			<el-button type="primary" @click="messendBymsg" class="add-msg" v-show="navList.index==1">+新增短信推送</el-button>
			<el-table :data="msgpush.tablelist" border style="width: 100%">

				<el-table-column :prop="item.title" :label="item.mean" align="center" v-for="(item,index) in msgpush.tableTitle"
				 :key="index">
				</el-table-column>
				<el-table-column fixed="right" label="操作" align="center">
					<template slot-scope="scope">
						<el-button @click="detailsMsg(scope.row)" type="text" size="small">详细内容</el-button>
						<!-- <el-button type="text" @click="withdraw(scope.row)" size="small" :style="scope.row.state == 1?'color:red':'color:grey'">{{scope.row.state == 1 ? '撤回':'已撤回'}}</el-button> -->
					</template>
				</el-table-column>
			</el-table>
		</div>
		<div style="padding: 20px 0;">
			<el-pagination @current-change="handleCurrentChange" @size-change="handleSizeChange" 
				:total="total" :page-sizes="[10, 20, 30, 50, 100]" :current-page="form.pagenum" 
				:page-size="form.pagesize" layout="total, sizes, prev, pager, next, jumper"
				background>
			</el-pagination>
		</div>
		<!-- 简历详情弹窗 -->
		<el-dialog :visible.sync="dialogVisible" width="1040px">
			<resume-detail v-if="dialogVisible" :userid="userid" :nickName="nickName" :isShowTelphone="true"></resume-detail>
		</el-dialog>
		<!-- 黑名单页面-提醒操作弹窗-->
		<el-dialog :visible.sync="warnDialogVisible" width="500px" @close="closeWarnDialog">
			<div class="warn-dialog-header">
				<span>提醒操作</span>
			</div>
			<div class="warn-dialog-body">
				<div class="warn-dialog-body-title">发送内容</div>
				<el-input type="textarea" :rows="6" v-model.trim="warnForm.remindcontent" placeholder="请输入提醒内容"></el-input>
				<div class="warn-dialog-btn">
					<el-button style="margin-right: 30px;" @click="warnDialogVisible = false">取消</el-button>
					<el-button type="primary" @click="warn">确定</el-button>
				</div>
			</div>
		</el-dialog>
		<!-- 黑名单页面-拉黑操作弹窗-->
		<el-dialog :visible.sync="blacklistDialogVisible" width="500px" @close="closeblacklistDialog">
			<div class="warn-dialog-header">
				<span>拉黑操作</span>
			</div>
			<div class="warn-dialog-body">
				<div class="warn-dialog-body-title">拉黑原因</div>
				<el-input type="textarea" :rows="6" v-model.trim="blacklistForm.blackreason"></el-input>
				<div class="warn-dialog-btn">
					<el-button style="margin-right: 30px;" @click="blacklistDialogVisible = false">取消</el-button>
					<el-button type="primary" @click="blacklist('1')">确定</el-button>
				</div>
			</div>
		</el-dialog>
		<!-- 黑名单页面-上报操作弹窗-->
		<el-dialog :visible.sync="reportDialogVisible" width="500px" @close="closeReportDialog">
			<div class="warn-dialog-header">
				<span>上报操作</span>
			</div>
			<div class="warn-dialog-body">
				<div class="warn-dialog-body-title">上报内容</div>
				<el-input type="textarea" :rows="6" v-model.trim="reportForm.content"></el-input>
				<div class="warn-dialog-btn">
					<el-button style="margin-right: 30px;" @click="reportDialogVisible = false">取消</el-button>
					<el-button type="primary" @click="report()">确定</el-button>
				</div>
			</div>
		</el-dialog>
		<!-- 添加新消息模板 -->
		<el-dialog :visible.sync="msgpush.newmsgDialog" width="850px" class="new-msg" top center>
			<h3 class="newmsg-header">{{pushtitle}}</h3>
			<span class="posttitle" >推送群体：</span>
			<el-radio-group v-model="statusname" @change="getvalue">
			      <el-radio-button :label="countPeopleByAll" value="1"></el-radio-button>
			      <el-radio-button :label="countPeopleByHr"  value="2"></el-radio-button>
			      <el-radio-button :label="countPeopleByJobseeker"  value="3"></el-radio-button>
				   <el-radio-button :label="countPeopleBy7"  value="4"></el-radio-button>
				    <el-radio-button :label="countPeopleBy30"  value="5"></el-radio-button>
			    </el-radio-group>
			<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="msgpush.textarea" class="msg-textarea">
			</el-input>
			 
			<el-upload  :class="{'disabledActive':disAcitve}"  :before-upload="uploadbefor"  style="padding: 5px 32px;"  action="https://house.fcw-china.com/wechat/common/fileUpload" :data="{condition:3}"
            list-type="picture-card"  :disabled="disAcitve"   accept="image/jpg,image/jpeg,image/png"
             :file-list="fileList" 
            :on-success="e => { uploadSuccess(e) }" :on-remove="handleRemove">
            <i  class="el-icon-plus plus"   v-show="!disAcitve"></i>


          </el-upload>
			<span slot="footer" class="dialog-footer">
				<el-button @click="msgpush.newmsgDialog = false;">取 消</el-button>
				<el-button type="primary" @click="sendNews" :disabled="btndisabled">确 定</el-button>
			</span>
		</el-dialog>
		<!-- 推送消息-消息内容详情弹窗 -->
		<el-dialog :visible.sync="detailShow" width="1200px" class="new-msg" top center>
			<img style="width: 100%;" :src="detailImg" alt="">
		</el-dialog>
		<el-dialog :visible.sync="msgpush.detailsDialog" width="500px" class="new-msg" top center>
			<h3 class="newmsg-header">详细内容信息</h3>
			<p class="shortmsg">{{msgpush.shortmsg}}</p>
			<div class="imgBox" v-if="msgpush.msgPic">
				<img class="picImg" v-for="item in msgpush.msgPic" :src="item" alt="" @click="lookDetail(item)"> 
			</div>
			
		</el-dialog>
		<!-- 工资单列表-查看下详情弹窗 -->
		<payrollDetails :options="payrollDetailMsg" @changePageNum="changePageNum" @changePageSize="changePageSize"></payrollDetails>

		<payrollImportDialog :options="payrollImportMsg" @updateList="getPayrollList"></payrollImportDialog>
		<el-dialog
		  :visible.sync="centerDialogVisible"
		  width="20%"
		  center>
		  <span style="font-size: 18px;
					   line-height: 90px;
					   display: inline-block;
					   width: 100%;
					   text-align: center;
						">是否确认展示该工资单内容</span>
		  <span slot="footer" class="dialog-footer">
		    <el-button @click="centerDialogVisible = false">取 消</el-button>
		    <el-button type="primary" @click="opendisplay_go">确 定</el-button>
		  </span>
		</el-dialog>
	</div>
</template>

<script src="./index.js"></script>
<style src="./index.css" scoped></style>
